﻿#pragma once
#include "yzrutil.h"
#include "DSP.h"

namespace yzrilyzr_dsp{
	ECLASS(AmpMultiply, public DSP){
	public:
	u_sample value=1;
	AmpMultiply();
	AmpMultiply(u_sample v) :value(v){}
	u_sample procDsp(u_sample input) override{
		return input * value;
	}
	void init(u_sample_rate sampleRate) override{}
	void resetMemory() override{}
	std::shared_ptr<DSP> cloneDSP() override{
		return std::make_shared < AmpMultiply>(value);
	}
	void setValue(u_sample v){
		value=v;
	}
	void cloneParam(DSP * obj1)override{
		if(auto other=dynamic_cast<AmpMultiply *>(obj1)){
			value=other->value;
		}
	}
	yzrilyzr_lang::String toString()const override;
	};
}